package com.budwk.app.sqfw.enums;

import lombok.Getter;

/**
 * 垃圾分类巡查
 */
@Getter
public enum RubbishClassPatrolEnum {

    RUBBISH_CLASS_LIST(1, "垃圾分类清单");


    private Integer code;

    private String name;

    RubbishClassPatrolEnum(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    /**
     * @param code
     * @return
     */
    public static String getName(Integer code) {
        for (RubbishClassPatrolEnum o : RubbishClassPatrolEnum.values()) {
            if (o.getCode() == code) {
                return o.getName();
            }
        }
        return null;
    }

    /**
     * @param name
     * @return
     */
    public static Integer getCode(String name) {
        for (RubbishClassPatrolEnum o : RubbishClassPatrolEnum.values()) {
            if (o.getName().equals(name)) {
                return o.getCode();
            }
        }
        return null;
    }
}
